package Common;

import java.io.Serializable;

/**
 * This class contains everything the client need in order to process an answer from the server
 * @author ori ziv
 *
 */
public class ServerAnswer implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3796179611204337388L;
	
	private final SERVER_COMMANDS command;
	private final Object answer;
	private String message = null;
	
	/**
	 * @param command
	 * @param response
	 */
	public ServerAnswer(SERVER_COMMANDS command, Object response) {
		super();
		this.command = command;
		this.answer = response;
	}
	
	public ServerAnswer(SERVER_COMMANDS command, Object response, String message) {
		super();
		this.command = command;
		this.answer = response;
		this.setMessage(message);
	}
	
	public SERVER_COMMANDS getCommand() {
		return command;
	}
	public Object getAnswer() {
		return answer;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
